Skip to content

Expose acceleration_trust_factor in Python bindings#214

Open
bodono wants to merge 2 commits into
masterfrom
expose-aa-trust-factor
Open

Expose acceleration_trust_factor in Python bindings#214
bodono wants to merge 2 commits into
masterfrom
expose-aa-trust-factor

Conversation

@bodono

@bodono bodono commented Jun 5, 2026

Copy link
Copy Markdown
Owner

Summary

Plumbs the new acceleration_trust_factor setting (added in cvxgrp/scs#396) through the scs Python kwargs interface.

  • Adds acceleration_trust_factor to the kwlist and argparse format in scs/scsobject.h
  • Adds Python-side validation (rejects NaN / non-positive values)
  • Bumps scs_source submodule to the corresponding scs branch
  • Adds coverage tests for the default (math.inf = no cap, current HEAD behavior), a sweep of positive finite values, and rejection of bad inputs

The default is math.inf which preserves the current HEAD behavior bit-for-bit. Positive finite values turn on the trust-region + adaptive-r mode from the underlying aa library (PR #54 there), enabling parameter sweeps for further tuning.

Test plan

  • python -m pytest test/test_scs_coverage.py — 286/286 pass
  • python -m pytest test/test_scs_basic.py test/test_scs_object.py — 26/26 pass
  • New trust_factor tests all pass (default, sweep, rejection)
  • Smoke-tested in REPL: default + explicit inf + finite values solve; 0 / -1 / NaN rejected

Depends on cvxgrp/scs#396 being merged before this can land cleanly.

bodono added 2 commits June 5, 2026 11:41
Plumbs the new ScsSettings.acceleration_trust_factor field through
the Cython kwargs interface. Defaults to math.inf (no cap, matches
current SCS HEAD behavior); positive finite values activate the
trust-region + adaptive-r mode from the underlying aa library.

Bumps scs_source submodule to pick up the C-side change.

Validation rejects NaN and non-positive values. Adds coverage tests
for the default, finite/inf sweep, and rejection cases.
Pulls in the cvxgrp/scs PR #396 fix that silences a gcc
-Wunused-result warning on the EOF-tolerant fread for
acceleration_trust_factor.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant